package com.dgj.mongo.entity;

import com.mongodb.BasicDBObject;
import com.mongodb.DBObject;

public class Sorter extends BasicDBObject{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	public static DBObject asc(String key) {
		BasicDBObject sort = new BasicDBObject();
		sort.append(key, 1);
		return sort;
	}
	
	public static DBObject desc(String key) {
		BasicDBObject sort = new BasicDBObject();
		sort.append(key, -1);
		return sort;
	}

}
